package com.banciyuan.bcywebview.utils.http;

import android.text.TextUtils;

/**
 * Created by squall on 2016/5/9.
 */
public class ProxyExist {

    /**
     * 检测系统是否已经设置代理，请参考HttpDNS API文档。
     */
    public static boolean detectIfProxyExist() {

        String proxyHost = System.getProperty("http.proxyHost");
        String port = System.getProperty("http.proxyPort");
        int proxyPort = Integer.parseInt(port != null ? port : "-1");
        return !TextUtils.isEmpty(proxyHost) && proxyPort > 0;
    }
}
